---
layout: default
title: Installation &middot; The Rust Programming Language
---
    <h1 class="rustup">Install Rust</h1>

    <div class="row rustup-row">
      <div class="col-md-8 instr-column">
        <div id="platform-instructions-unix" class="instructions" style="display: none;">
          <p>To install Rust, run the following in your terminal, then follow the onscreen instructions.</p>
          <pre>curl https://sh.rustup.rs -sSf | sh</pre>
        </div>

        <div id="platform-instructions-win" class="instructions" style="display: none;">
          <p>
            To install Rust, download and run
            <a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
            then follow the onscreen instructions.
          </p>
          <p>If you're a Windows Subsystem for Linux user run the following in your terminal, then follow the onscreen instructions to install Rust.</p>
          <pre>curl https://sh.rustup.rs -sSf | sh</pre>
        </div>

        <div id="platform-instructions-unknown" class="instructions" style="display: none;">
          <!-- unrecognized platform: ask for help -->
          <p>I don't recognize your platform.</p>
          <p>
            Rust runs on Windows, Linux, Mac OS X, FreeBSD and NetBSD. If
            you are on one of these platforms and are seeing this then please
            <a href="https://github.com/rust-lang/rust-www/issues/new">report an issue</a>,
            along with the following values:
          </p>

          <div>
            <div>navigator.platform:</div>
            <div id="nav-plat"></div>
            <div>navigator.appVersion:</div>
            <div id="nav-app"></div>
          </div>

          <!-- duplicate the default cross-platform instructions -->
          <div>
            <p>To install Rust, if you are running Unix,<br/>run the following
            in your terminal, then follow the onscreen instructions.</p>
            <pre>curl https://sh.rustup.rs -sSf | sh</pre>
          </div>

          <hr/>

          <div>
            <p>
              If you are running Windows,<br/>download and run
              <a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
              then follow the onscreen instructions.
            </p>
          </div>
        </div>

        <div id="platform-instructions-default" class="instructions">
          <div>
            <p>To install Rust, if you are running Unix,<br/>run the following
            in your terminal, then follow the onscreen instructions.</p>
            <pre>curl https://sh.rustup.rs -sSf | sh</pre>
          </div>

          <hr/>

          <div>
            <p>
              If you are running Windows,<br/>download and run
              <a href="https://win.rustup.rs">rustup&#x2011;init.exe</a>
              then follow the onscreen instructions.
            </p>
          </div>
        </div>

      </div>

      <div class="col-md-4 release-info-column">
        <div>
          <div class="release-version">Rust <span>{{ site.stable }}</span></div>
          <a href="{{ site.stable_blog }}">
            <div class="release-date">{{ site.stable_date | date: "%B %-d, %Y" }}</div>
          </a>

          <br>

          <a id="platform-button" style="display: none;" href="#">
            click or press "n" to cycle platforms
          </a>
        </div>
      </div>

    </div>

    <h2>Notes about Rust installation</h2>

    <div class="row">
      <div class="col-md-12">

        <h3>Toolchain management with <code>rustup</code></h3>

        <p>
          Rust is installed and managed by the
          <a href="https://github.com/rust-lang-nursery/rustup.rs"><code>rustup</code></a>
          tool. Rust has a 6-week
          <a href="https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md">
            rapid release process
          </a> and supports a
          <a href="https://forge.rust-lang.org/platform-support.html">
             great number of platforms
          </a>, so there are many builds of Rust available at any time.
          <code>rustup</code> manages these builds in a consistent way on every
          platform that Rust supports, enabling installation of Rust from the
          beta and nightly release channels as well as support for additional
          cross-compilation targets.
        </p>

        <p>
          For more information see the
          <a href="https://github.com/rust-lang-nursery/rustup.rs/blob/master/README.md"><code>rustup</code>
          documentation</a>.
        </p>

        <h3>Configuring the <code>PATH</code> environment variable</h3>

        <p>
          In the Rust development environment, all tools are installed to the
          <span class="platform-specific not-win" style="display: inline;">
            <code>~/.cargo/bin</code>
          </span>
          <span class="platform-specific win" style="display: none;">
            <code>%USERPROFILE%\.cargo\bin</code>
          </span> directory,
          and this is where you will find the Rust toolchain, including
          <code>rustc</code>, <code>cargo</code>, and <code>rustup</code>.
        </p>

        <p>
          Accordingly, it is customary for Rust developers to include this
          directory in their
          <a href="https://en.wikipedia.org/wiki/PATH_(variable)"><code>PATH</code>
          environment variable</a>.  During installation <code>rustup</code>
          will attempt to configure the
          <code>PATH</code>. Because of differences between platforms,
          command shells, and bugs in <code>rustup</code>, the modifications
          to <code>PATH</code> may not take effect until the console is
          restarted, or the user is logged out, or it may not succeed at all.
        </p>

        <p>
          If, after installation, running <code>rustc --version</code> in the
          console fails, this is the most likely reason.
        </p>

        <div class="platform-specific win">

          <h3>Windows considerations</h3>
          <!-- This anchor is probably linked in the wild and should not be broken -->
          <a id="win-foot"></a>

	  <p>
            On Windows, Rust additionally requires the C++ build tools
            for Visual Studio 2013 or later. The easiest way to acquire the build
            tools is by installing
	    <a href="https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017">
	      Microsoft Visual C++ Build Tools 2017
            </a>
            which provides just the Visual C++ build tools. Alternately, you
	    can <a href="https://www.visualstudio.com/downloads/">install</a>
	    Visual Studio 2017, Visual Studio 2015, or Visual Studio 2013 and during install select
	    the "C++ tools".
	  </p>

          <p>
            For further information about configuring Rust on Windows see the
            <a href="https://github.com/rust-lang-nursery/rustup.rs/blob/master/README.md#working-with-rust-on-windows">Windows-specific <code>rustup</code>
            documentation</a>.
          </p>

        </div>

      </div>
    </div>

    <h2>Other installation methods</h2>

    <div class="row">
      <div class="col-md-12">
        <p>
          The installation described above, via
          <code>rustup</code>, is the preferred way to install Rust for most developers.
          However, Rust can be
          <a href="other-installers.html">installed via other methods</a>
          as well.
        </p>
      </div>
    </div>

    <script type="text/javascript">
      {% include rustup.js %}
    </script>

